// $codepro.audit.disable
/* Copyright (c) 2011 Team A CS2340. All rights reserved.*/

package edu.gatech.teama.doctorsoffice.client.view.scheduler;

import java.util.ArrayList;
import java.util.Iterator;

import org.joda.time.LocalDate;
import org.joda.time.LocalTime;

import com.thirdnf.ResourceScheduler.AbstractScheduleModel;
import com.thirdnf.ResourceScheduler.AppointmentVisitor;
import com.thirdnf.ResourceScheduler.Availability;
import com.thirdnf.ResourceScheduler.Resource;
import com.thirdnf.ResourceScheduler.ResourceVisitor;

public class AppointmentRequestSchedulerModel extends AbstractScheduleModel {

	private Resource resource1 = new DoctorResource("Dr. One");

	private Resource resource2 = new DoctorResource("Dr. Two");
	
	@Override
	public LocalTime getStartTime(LocalDate arg0) {
		return new LocalTime(8, 0, 0);
	}
	
	@Override
	public LocalTime getEndTime(LocalDate arg0) {
		return new LocalTime(17, 0, 0);
	}

	@Override
	public void visitAppointments(AppointmentVisitor arg0, LocalDate arg1) { // $codepro.audit.disable emptyMethod
		// TODO Auto-generated method stub

	}

	@Override
	public void visitResources(ResourceVisitor resourceVisitor, LocalDate localDate) {
		resourceVisitor.visitResource(resource1); // $codepro.audit.disable com.instantiations.assist.eclipse.analysis.unusedReturnValue
		resourceVisitor.visitResource(resource2); // $codepro.audit.disable com.instantiations.assist.eclipse.analysis.unusedReturnValue

	}
	
	private static class DoctorResource implements Resource {

		private final String title;
		
		private DoctorResource(String title) {
			this.title = title;
		}
		
		@Override
		public Iterator<Availability> getAvailability(LocalDate arg0) {
			return (new ArrayList<Availability>()).iterator();
		}

		@Override
		public String getTitle() {
			return title;
		}
		
	}

}
